package cn.yoyo.tools;

import cn.yoyo.entity.SysUser;
import org.springframework.security.core.context.SecurityContextHolder;


public class GetUser {
    public static SysUser getUser() {
        Object principal = SecurityContextHolder.getContext().getAuthentication().getPrincipal();
        SysUser user = (SysUser) principal;
        return user;
    }

}
